package com.chidopi.market.aa.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import com.chidopi.cdf.service.IBaseService;
import com.chidopi.cdf.service.ICommonService;
import com.chidopi.cdf.service.impl.CommonServiceImpl;
import com.chidopi.cdf.tag.ITagDao;
import com.chidopi.market.aa.dao.DaoConfig;
import com.chidopi.market.aa.domain.Accounts;
import com.chidopi.market.aa.domain.FunctionItems;
import com.chidopi.market.aa.domain.Functions;
import com.chidopi.market.aa.domain.Roles;
import com.chidopi.market.aa.service.impl.AccountServiceImpl;
import com.chidopi.market.aa.service.impl.FunctionItemServiceImpl;
import com.chidopi.market.aa.service.impl.FunctionServiceImpl;
import com.chidopi.market.aa.service.impl.PasswordServiceImpl;
import com.chidopi.market.aa.service.impl.PermissionServiceImpl;
import com.chidopi.market.aa.service.impl.RoleServiceImpl;

@Configuration
@Import(DaoConfig.class)
public class ServiceConfig {
	private static Logger logger = LoggerFactory.getLogger(ServiceConfig.class);

	@Bean(name="commonService")
	public ICommonService commonService() {
		logger.debug("commonService is called!!");
		return new CommonServiceImpl();
	}

	@Bean(name="accountService")
	public IBaseService<Accounts> accountService() {
		logger.debug("accountService is called!!");
		return new AccountServiceImpl();
	}

	@Bean(name="functionService")
	public IBaseService<Functions> functionService() {
		logger.debug("functionService is called!!");
		return new FunctionServiceImpl();
	}

	@Bean(name="roleService")
	public IBaseService<Roles> roleService() {
		logger.debug("roleService is called!!");
		return new RoleServiceImpl();
	}

	@Bean(name="itemService")
	public IBaseService<FunctionItems> itemService() {
		logger.debug("itemService is called!!");
		return new FunctionItemServiceImpl();
	}

	@Bean(name="permissionService")
	public IPermissionService permissionService() {
		logger.debug("permissionService is called!!");
		return new PermissionServiceImpl();
	}

	@Bean(name="tagService")
	public ITagDao tagService() {
		logger.debug("permissionService is called!!");
		return new PermissionServiceImpl();
	}
	
	@Bean(name="passwordService")
	public IPasswordService passwordService() {
		logger.debug("passwordService is called!!");
		return new PasswordServiceImpl();
	}
}
